package cn.rkylin.oms.warehouseDocking.dao;

import cn.rkylin.core.IDataBaseFactory;
import cn.rkylin.oms.warehouseDocking.domain.Stockin;
import cn.rkylin.oms.warehouseDocking.domain.StockinSku;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * 入库单数据访问层具体实现
 *
 * @author fengwang
 * @created 2017年11月7日
 */
@Repository(value = "iStockinDAO")
public class StockinDAOImpl implements IStockinDAO {

    @Autowired
    protected IDataBaseFactory dao;

    private static final String updateByPrimaryKeySelectiveStockin = "updateByPrimaryKeySelectiveStockin";

    @Override
    public int updateByPrimaryKeySelectiveStockin(Stockin stockin) throws Exception {
        int iRtn = dao.update(updateByPrimaryKeySelectiveStockin, stockin);
        return iRtn;
    }

    /**
     * 更新 退货入库单商品成本价
     *
     * @param stockinSku
     * @return
     * @throws Exception
     */
    @Override
    public int updateStockinSkuById(StockinSku stockinSku) throws Exception {
        int iRtn = dao.update("updateStockinSkuById", stockinSku);
        return iRtn;
    }
}
